package com.siwei.mes.enums.laboratory;

import com.siwei.mes.enums.MaterialsEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;

import java.util.Arrays;

/**
 * 协会报表配置类型
 *
 * @Description: 报协会表配置类型
 * @Version: 1.0
 * @author: YANGKE
 * @date: 2024/8/23 22:31
 */
@Getter
public enum ReportIdEnum {
    CEMENT(1, "水泥","SN"),
    FLY(2, "粉煤灰","FMH"),
    SLAG(3, "矿渣粉","KF"),
    COARSE(4, "粗骨料","CGL"),
    FINE(5, "细骨料","XGL"),
    ADMIXTURE(6, "外加剂","WJJ"),
    CONCRETE_HKY(7, "混凝土抗压","HKY"),
    CONCRETE_HKS(8, "混凝土抗渗","HKS"),
    CONCRETE_HKZ(8, "混凝土抗渗","HKZ");
    @ApiModelProperty(value = "配置类型")
    private Integer code;
    @ApiModelProperty(value = "类型名称")
    private String name;
    @ApiModelProperty(value = "编号")
    private String no;

    ReportIdEnum(Integer code, String name,String no) {
        this.code = code;
        this.name = name;
        this.no = no;
    }

    /**
     * 根据code查找信息
     *
     * @param code 物料类型
     * @return
     */
    public static ReportIdEnum selectByCode(Integer code) {
        return Arrays.stream(values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }
}
